package com.eunion.web.cms.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 注册码转让
 */
@Entity
@Table(name = "t_register_code")
@NamedQuery(name = "TRegisterCode.findAll", query = "SELECT t FROM TRegisterCode t")
public class TRegisterCode {
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;
    
    private Integer userid;
    
    private String usercode;
    
    /** 注册码 **/
    private String code;
    
    /** 状态0未使用，1已使用,2作废 **/
    private Integer status;
    
    private Date createtime;
    
    private Date updatetime;
    
    @Transient
    private String username;

    
    public Integer getId() {
        return id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }
    
    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String usercode) {
        this.usercode = usercode;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public Date getCreatetime() {
        return createtime;
    }
    
    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }
    
    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public TRegisterCode(Integer id, Integer userid, String usercode, String code, Integer status, Date createtime, Date updatetime, String username) {
        super();
        this.id = id;
        this.userid = userid;
        this.usercode = usercode;
        this.code = code;
        this.status = status;
        this.createtime = createtime;
        this.updatetime = updatetime;
        this.username = username;
    }

    public TRegisterCode() {
        super();
    }

    @Override
    public String toString() {
        return "TRegisterCode [id=" + id + ", userid=" + userid + ", usercode=" + usercode + ", code=" + code + ", status=" + status + ", createtime=" + createtime + ", updatetime=" + updatetime
               + ", username=" + username + "]";
    }

}
